import { createRouter, createWebHistory } from 'vue-router';

import LoginView from '../components/LoginView.vue';
import HomeView from '../components/HomeView.vue';
import HeaderView from '@/view/HeaderView.vue';
import AdminIndex from '@/components/admin/AdminIndex.vue';
import RegisterView from '@/components/RegisterView.vue';
import AttractionsView from '@/components/AttractionsView.vue';
import CuisinesView from '@/components/CuisinesView.vue';
import DetailView from '@/components/DetailView.vue';
import UserInfo from '@/components/user/UserInfo.vue';
import MapContainer from '@/view/MapContainer.vue';


const routes =[
    {
        path:'/',
        name:'home',
        component:HomeView
    },
    {
        path:'/login',
        name:'login',
        component:LoginView
    },
    {
        path:'/header',
        component:HeaderView
    },
    {
        path:'/admin',
        name:'adminIndex',
        component:AdminIndex
    },
    {
        path:'/register',
        name:'register',
        component:RegisterView
    },
    {
        path: '/forget-password',
        name: 'forgetPassword',
        component: () => import('@/components/user/ForgetPasswordView.vue')
    },
    {
        path: '/attractions',
        name: 'attractions',
        component: AttractionsView
    },
    {
        path: '/cuisines',
        name: 'cuisines',
        component: CuisinesView
    },
    {
        path: '/communication',
        name: 'communication',
        component: () => import('@/components/UserCommunicationView.vue')
    },
    {
        path: '/detail/:type/:id',
        name: 'detail',
        component: DetailView
    },
    {
        path: '/go',
        name: 'go',
        component: () => import('@/components/GoView.vue')
    },
    {
        path: '/userinfo',
        name: 'userInfo',
        component: UserInfo
    },{
        path: '/map',
        name: 'map',
        component: () => import('@/view/MapContainer.vue')
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router